// File:     TestDriver.cpp
//
// Modified: 2011 Jan. 27
//
// 
//

#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <iostream>

#include "Blob.hpp"
#include "CircleDetection.hpp"
#include "Path.hpp"

using namespace std;

/*										
Image Processing Algorithm
(Edit as necessary)

- One thread 

- At every path calculation, a new Path object is created, which triggers a subsequent CircleDetection object, and a subsequent Blob object is created
- 


*/


int main()
{

	cvNamedWindow("img", CV_WINDOW_AUTOSIZE);	// Create a window that autosizes to the image
	Path* path = new Path ("shapes.jpg");
		

	// Blob Detection
	path ->getCircleDetection() ->getBlob() ->setHSV();
	path ->getCircleDetection() ->getBlob() ->setHue();


	path ->getCircleDetection() ->getBlob() ->setKernel();
	path ->getCircleDetection() ->getBlob() ->cancelNoise();
	

	// Circle Detection
	path ->getCircleDetection() ->setHoughCircles(1, 100, 50, 30, 1, 10000);
	path ->getCircleDetection() ->drawCircles();

	// Show Image
	cvShowImage("img", path ->getCircleDetection() ->getBlob() ->getImg());	// Show image

	cvWaitKey();
			
	path ->getCircleDetection() ->getBlob() ->~Blob();
	path ->getCircleDetection() ->~CircleDetection();
	cvDestroyWindow("img");

	return 0;
}